//package cn.maidouya.hrm.config;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.http.SessionCreationPolicy;
//import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
//import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
//import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
//import org.springframework.security.oauth2.provider.token.RemoteTokenServices;
//import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices;
//import org.springframework.security.oauth2.provider.token.TokenStore;
//import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
//import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
//
///**
// *  resource资源授权公共配置中心
// */
//@Configuration // 启动配置文件并交给spring管理
//public class ZullResourceServerConfig {
//
//    public static final String RESOURCE1_KEY = "systemId";
//    public static final String RESOURCE2_KEY = "systemId";
//
//    @Bean
//    public TokenStore tokenStore(){
//        return new JwtTokenStore(jwtAccessTokenConverter());
//    }
//    public static final String sign = "**itsource&……%￥%￥￥";
//    @Bean
//    public JwtAccessTokenConverter jwtAccessTokenConverter(){
//        JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
//        converter.setSigningKey(sign);
//        return converter;
//    }
//    @Configuration
//    @EnableResourceServer
//    public class AuthConfig extends ResourceServerConfigurerAdapter {
//        @Autowired
//        private TokenStore tokenStore;
//        @Override
//        public void configure (ResourceServerSecurityConfigurer resource) throws Exception{
//            resource.resourceId(RESOURCE1_KEY).tokenStore(tokenStore).stateless(true);
//        }
//        @Override
//        public void configure (HttpSecurity httpSecurity) throws Exception{
//            httpSecurity.authorizeRequests().antMatchers("/**").permitAll();
//        }
//    }
//    @Configuration
//    @EnableResourceServer
//    public class Resource2Config extends ResourceServerConfigurerAdapter {
//        @Autowired
//        private TokenStore tokenStore;
//        @Override
//        public void configure (ResourceServerSecurityConfigurer resource) throws Exception{
//            resource.resourceId(RESOURCE2_KEY).tokenStore(tokenStore).stateless(true);
//        }
//        @Override
//        public void configure (HttpSecurity httpSecurity) throws Exception{
//            httpSecurity.authorizeRequests().antMatchers("/**").permitAll();
//        }
//    }
//
//
//
//
//
//}